package rad.framework.conv;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public abstract class BaseCommand {

	protected static final Log log = LogFactory.getLog(BaseCommand.class);

	protected String persistenceUnitJndiName = "";
	protected String entityName = "";
	protected String path = "";

	protected BaseCommand(String persistenceUnitJndiName, String entityName) {
		this.persistenceUnitJndiName = persistenceUnitJndiName;
		this.entityName = entityName;
	}

	protected BaseCommand(String persistenceUnitJndiName) {
		this.persistenceUnitJndiName = persistenceUnitJndiName;
	}

	public abstract void execute() throws Exception;
	
	protected String getEntityName() {
		return entityName;
	}
	
	protected String getFileName() {
		return path + "/" + getEntityName() + ".xml";
	}

	public void setPath(String path) {
		this.path = path;
	}

	public void setPersistenceUnitJndiName(String persistenceUnitJndiName) {
		this.persistenceUnitJndiName = persistenceUnitJndiName;
	}
}
